package org.plex.core;

import java.util.Date;
import java.util.List;

import org.plex.model.TaskACL;
import org.plex.task.CompleteTaskResult;
import org.plex.task.CreateTaskInfo;
import org.plex.task.CreateTaskResult;
import org.plex.task.FormInstance;
import org.plex.task.TaskInfo;
import org.plex.task.TaskUserinfo;

import com.adobe.idp.taskmanager.dsc.client.task.TaskManagerException;

public interface TaskManager
{
	CreateTaskResult createTask(long actionId, FormInstance formdata,
			String instructions, long queueId, boolean copyAttachments,
			boolean showAttachments) throws TaskManagerException;

	CreateTaskResult createTask(long actionId, FormInstance formdata,
			String instructions, long queueId, List attachmentsToCopy,
			boolean showAttachements) throws TaskManagerException;

	CreateTaskResult createTask(FormInstance formdata, String instructions,
			boolean showAttachements) throws NullPointerException,
			TaskManagerException;

	CreateTaskResult createTask(CreateTaskInfo createTaskInfo)
			throws TaskManagerException;

	void reAssignTask(long taskId, String reAssignToUserOid)
			throws TaskManagerException;

	void escalateTask(long taskId, long queueId) throws TaskManagerException;

	void consultTask(long taskId, String userOidToConsult)
			throws TaskManagerException;

	void forwardTask(long taskId, String userIoForward)
			throws TaskManagerException;

	void shareTask(long taskId, String userOidToShare)
			throws TaskManagerException;

	void claimTask(long taskId) throws TaskManagerException;

	void rejectTask(long taskId) throws TaskManagerException;

	void changeQueueForTask(long taskId, long targetQueueId)
			throws TaskManagerException;

	void cancelTask(long taskId) throws TaskManagerException;

	CompleteTaskResult completeTask(long taskId) throws TaskManagerException;

	CompleteTaskResult completeTask(long taskId, String selectedAction)
			throws TaskManagerException;

	CompleteTaskResult completeTask(long taskId, FormInstance formInstance)
			throws TaskManagerException;

	CompleteTaskResult deadlineTask(long taskId, String deadlineAction,
			boolean changeInstructions, String deadlineInstructions)
			throws TaskManagerException;

	CompleteTaskResult terminateTask(long taskId) throws TaskManagerException;

	List<CompleteTaskResult> terminateTasksForJobId(String jobId)
			throws TaskManagerException;

	void sendTaskReminder(long taskId, boolean changeInstructions,
			String reminderInstructions, long nextReminder)
			throws TaskManagerException;

	void sendTaskReminder(long taskId, boolean changInstructions,
			String reminderInstructions, long nextReminder,
			boolean userBusinessDays) throws TaskManagerException;

	TaskInfo getTaskInfo(long taskId) throws NullPointerException,
			TaskManagerException;

	TaskInfo getTaskInfo(long taskId, boolean returnFormInstance)
			throws NullPointerException, TaskManagerException;

	List<TaskUserinfo> getUsersWithAccessToTask(long taskId)
			throws TaskManagerException;

	void modifyTaskPermissions(long taskId, List<? extends TaskACL> taskList)
			throws TaskManagerException;

	void lockTask(long taskId) throws TaskManagerException;

	void changeDeadline(long taskId, Date newDeadline)
			throws TaskManagerException;

	void changeReminder(long taskId, Date newReminder)
			throws TaskManagerException;

	void claimTask(long taskId, boolean locktask);

	void setVisibility(long taskId, boolean visible)
			throws TaskManagerException;

	void changedescription(long taskId, String updateDesciption)
			throws TaskManagerException;

}
